import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'
import { AichatService } from './aichat.service'
import { CreateAichatDto } from './dto/create-aichat.dto'
import { UpdateAichatDto } from './dto/update-aichat.dto'

@Controller('aichat')
export class AichatController {
  constructor(private readonly aichatService: AichatService) {}

  // 前端发来的对话内容
  @Post()
  chatContent(@Body() body: any) {
    return this.aichatService.chatContent(body)
  }

  @Get()
  findAll() {
    return this.aichatService.findAll()
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.aichatService.findOne(+id)
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateAichatDto: UpdateAichatDto) {
    return this.aichatService.update(+id, updateAichatDto)
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.aichatService.remove(+id)
  }
}
